using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace DriverSVH
{
    public struct SVHCurrentSettings
    {
        //! Reference signal minimum value
        public float wmn;
        //! Reference signal maximum value
        public float wmx;
        //! Measurement scaling
        public float ky;
        //! Time base of controller
        public float dt;
        //! Integral windup minimum value
        public float imn;
        //! Integral windup maximum value
        public float imx;
        //! Proportional gain
        public float kp;
        //! Integral gain
        public float ki;
        //! Output limiter min
        public float umn;
        //! Output limiter max
        public float umx;
        public SVHCurrentSettings(float[] pos_settings)
        {
            int size = pos_settings.Length;
            wmn = (size > 0) ? pos_settings[0] : 0.0f;
            wmx = (size > 1) ? pos_settings[1] : 0.0f;
            ky = (size > 2) ? pos_settings[2] : 0.0f;
            dt = (size > 3) ? pos_settings[3] : 0.0f;
            imn = (size > 4) ? pos_settings[4] : 0.0f;
            imx = (size > 5) ? pos_settings[5] : 0.0f;
            kp = (size > 6) ? pos_settings[6] : 0.0f;
            ki = (size > 7) ? pos_settings[7] : 0.0f;
            umn = (size > 8) ? pos_settings[8] : 0.0f;
            umx = (size > 9) ? pos_settings[9] : 0.0f;
        }

        public SVHCurrentSettings(float _wmn, float _wmx, float _ky, float _dt, float _imn, float _imx, float _kp, float _ki, float _umn, float _umx)
        {
            wmn = _wmn;
            wmx = _wmx;
            ky = _ky;
            dt = _dt;
            imn = _imn;
            imx = _imx;
            kp = _kp;
            ki = _ki;
            umn = _umn;
            umx = _umx;
        }
    }
}
